// 房东相关请求

import { DataListParams, DeleteParams, AEParams, ResultModel } from './model'
// import { useGlobSetting } from '/@/hooks/setting'
import { defHttp } from '/@/utils/http/axios'
import { ErrorMessageMode, UploadFileParams } from '/@/utils/http/axios/types'

enum Api {
    dataListUrl = '/auth/admin/list',
    deleteUrl = '/admin/TypeLabel/del',
    addUrl = '/admin/TypeLabel/add',
    editUrl = '',
}

/**
 * @description: 获取子账号列表
 */
export function dataListApi(params: DataListParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request<ResultModel>(
        {
            url: Api.dataListUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}

/**
 * @description: 删除子账号
 */
export function deleteApi(params: DeleteParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.deleteUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}

/**
 * @description: 更新子账号
 */
export function updateApi(params: AEParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.editUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}

/**
 * @description: 添加子账号
 */
export function addApi(params: AEParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.addUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}

// /**
//  * @description: 编辑审核信息
//  */
// export function editLandLordCheckApi(
//     params: UploadFileParams,
//     onUploadProgress?: (progressEvent: ProgressEvent) => void
// ) {
//     return defHttp.uploadFile(
//         {
//             url: useGlobSetting().apiUrl + Api.editCheckData,
//             onUploadProgress,
//         },
//         params
//     )
// }

// /**
//  * 添加房东
//  * @param params
//  * @param onUploadProgress
//  */
// export function addLandLordCheckApi(
//     params: UploadFileParams,
//     onUploadProgress?: (progressEvent: ProgressEvent) => void
// ) {
//     return defHttp.uploadFile(
//         {
//             url: useGlobSetting().apiUrl + Api.add,
//             onUploadProgress,
//         },
//         params
//     )
// }
